Error Dialog
fun ErrorDialog(_: Nothing = nothing, throwable: Throwable, modifier: Modifier = Modifier, icon: @Composable () -> Unit? = null, title: @Composable () -> Unit? = {
Text(text = stringResource(R.string.ly_img_editor_dialog_error_title))
}, text: @Composable () -> Unit? = {
Text(
text = (throwable as? EngineException)?.getDisplayMessage(LocalContext.current)
?: throwable.message ?: "",
)
}, confirmButton: @Composable () -> Unit = {
TextButton(
onClick = {
error = null
editorContext.eventHandler.send(EditorEvent.CloseEditor(throwable))
},
) {
Text(stringResource(R.string.ly_img_editor_dialog_error_confirm_text))
}
}, dismissButton: @Composable () -> Unit? = null, onDismissRequest: () -> Unit = {}, properties: DialogProperties = DialogProperties(dismissOnBackPress = false, dismissOnClickOutside = false), __: Nothing = nothing)
A helper composable function for displaying a dialog when the editor captures a throwable.
Parameters
throwable
the throwable that was thrown.
modifier
the modifier to apply to the dialog.
icon
the icon to display in the dialog.
title
the title of the dialog.
text
the text of the dialog.
confirm Button
the confirm button of the dialog.
dismiss Button
the dismiss button of the dialog.
on Dismiss Request
executes when the user tries to dismiss the dialog.
properties
the properties of the dialog.